package aa;
import java.util.*;
import static java.lang.System.out;
class Book implements Comparable<Book>{
	private Double price;
	private String name;
	Book(double price, String name){
		this.price = price;
		this.name = name;
	}
	public void setPrice(Double price){
		this.price = price;
	}
	public Double getPrice(){
		return this.price;
	}
	public String getName(){
		return this.name;
	}
	public int compareTo(Book obj){
		return this.name.compareTo(obj.name);
	}
}
public class Set {
	public static void main(String args[]){
		TreeSet<Book> ts = new TreeSet<Book>();
		Book book1 = new Book(100.0,"A");
		Book book2 = new Book(200.0, "a");
		Book book3 = new Book(300.0, "C");
		ts.add(book3);
		ts.add(book1);
		ts.add(book2);
		
		out.println("add work? "+ ts.add(book1));
		for(Book book:ts){
			out.println(book.getName());
		}
	}
}
